#include <iostream>
#include <memory>
#include "ThreadPool.hpp"

class Task
{
public:
    void operator()()
    {
        std::cout << "task executing ..." << std::endl;
        sleep(1);
    }
};

int main()
{
    std::unique_ptr<ThreadPool<Task>> threadPool(ThreadPool<Task>::getInstance());
    threadPool->start();
    while(true)
    {
        threadPool->submit(Task());
        sleep(1);
    }
    return 0;
}